<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>test</title>
</head>
<body>
<div id="a" style="border: 1px red solid;">

  <input type="button" value="点我" onclick="click()"/>
  <div id="fuce" style="border: 1px greenyellow solid;display: none">浮层</div>
</div>



<script src="moment.js"></script>
<script src="jquery-3.4.1.min.js"></script>

<script>
  function click() {
    console.log('dissss')

    const dis=document.getElementById('fuce').style.display

    document.getElementById('fuce').style.display=dis==='block'?'none':'block'
  }



  // if (state.popupVisible) {
  //   let currentDocument
  //   if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
  //     currentDocument = props.getDocument();
  //     this.clickOutsideHandler = addEventListener(currentDocument, 'mousedown', onDocumentClick);
  //   }
  //   // always hide on mobile
  //   if (!this.touchOutsideHandler) {
  //     currentDocument = currentDocument || props.getDocument();
  //     this.touchOutsideHandler = addEventListener(currentDocument, 'touchstart', onDocumentClick);
  //   }
  //   // close popup when trigger type contains 'onContextMenu' and document is scrolling.
  //   if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
  //     currentDocument = currentDocument || props.getDocument();
  //     this.contextMenuOutsideHandler1 = addEventListener(currentDocument, 'scroll', this.onContextMenuClose);
  //   }
  //   // close popup when trigger type contains 'onContextMenu' and window is blur.
  //   if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
  //     this.contextMenuOutsideHandler2 = addEventListener(window, 'blur', this.onContextMenuClose);
  //   }
  //   return;
  // }
  //
  // function onDocumentClick(event) {
  //   if (_this5.props.mask && !_this5.props.maskClosable) {
  //     return;
  //   }
  //
  //   var target = event.target;
  //   var root = findDOMNode(_this5);
  //   if (!contains(root, target) && !_this5.hasPopupMouseDown) {
  //     _this5.close();
  //   }
  // };



</script>


</body>
</html>
